package com.bc.bclocalserviceapihttp.controller;

import com.bc.bcapi.service.T_Mng_email_sysService;
import com.bc.bcmodel.domain.T_Mng_email_confModel;
import com.bc.bcmodel.domain.T_Mng_email_sysModel;
import com.bc.bcmodel.req.SendMailModelReq;
import com.bc.commoncore.util.JsonUtil;
import com.bc.commonentity.common.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Name EmailController
 * @Description TODO
 * @Author douhaichao
 * @Date 2018/9/13 11:20
 * @Version 1.0
 **/
@RestController
@Api("邮件发送管理")
@RequestMapping("email")
public class EmailController {

    @Autowired
    T_Mng_email_sysService t_mng_email_sysService;

    @RequestMapping(value = "sendsysemail", method = RequestMethod.POST)
    @ApiOperation("发送系统邮件")
    public int sendSysEmail(@RequestBody
                                    SendMailModelReq req) {
        int status = t_mng_email_sysService.Send(req.getFrom(), req.getTo());
        return status;
    }
}
